JBoss Community Archive (Read Only)

Infinispan 6.0

How does Infinispan support implicit eager locking?

Implicit locking goes one step ahead and locks cache keys behind the scene as keys are accessed for modification operations.

Consider a transaction running on one of the cache nodes:

   tx.begin() 
   cache.put(K,V)    // acquire cluster wide lock on K 
   cache.put(K2,V2)  // acquire cluster wide lock on K2 
   cache.put(K,V5)   // no-op, we already own cluster wide lock for K 
   tx.commit()       // releases locks

Implicit eager locking locks cache keys across cluster nodes only if it is necessary to do so. In a nutshell, if implicit eager locking is turned on then for each modification Infinispan checks if cache key is locked locally. If it is then a global cluster wide lock has already been obtained, otherwise a cluster wide lock request is sent and lock is acquired.

Implicit eager locking is enabled as follows:

<transaction useEagerLocking="true" />

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 09:41:24 UTC, last content change 2011-07-18 12:46:58 UTC.